import { request } from '../util/request'

export const permission = {
  getPermissionForButton: (query) => {
    return
    // return request('/authority/getAuthBtnCodes?t=' + (new Date().getTime()), query)
    //   .then(data => {
    //     return Promise.resolve(typeof data !== 'undefined' ? data.split(',') : 'undefined')
    //   })
  }
}

export const indexApi = {
  updatePasswd: (body) => request('/password?t=' + (new Date().getTime()), body, 'put'),
  logOut: (query) => request('/logout?t=' + (new Date().getTime()), query, 'delete'),
  getNavs: (query) => request('/modules?t=' + (new Date().getTime()), query),
  getMenusByModule: ({moduleId}) => request(`/menus/${moduleId}?t=` + (new Date().getTime())),
  loginNew: (type, body) => request(((type === 'ldap') ? '/login_ldap?t=' : '/login?t=') + (new Date().getTime()), body, 'post')
}
